package Demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-06-12
 * Time: 19:35
 */
public class A{
    public static int a = 1;
    protected int b = 100;
    static{
        System.out.println("a = " + a);
        a = 2;
        System.out.println("a = " + a);
        System.out.println("父类静态代码块执行中...");
    }
    {
        System.out.println("b = " + b);
        b = 200;
        System.out.println("b = " + b);
        System.out.println("父类实例代码块执行中...");
    }
    public A(){
        System.out.println("父类构造方法执行中...");
    }
}
class B extends A{
    static{
        System.out.println("子类静态代码块执行中...");
    }
    {
        System.out.println("子类实例代码块执行中...");
    }
    public B(){
        super();
        System.out.println("父类构造方法执行中...");
    }
}